package cate.game.res.treasureturntable;

import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;

public class TreasureTurntableLog {
    @NoteField(value = "日志")
    public List<TreasureTurntableLogDetail> logs;

    public TreasureTurntableLog(){

    }

    public void initialize() {
        if (logs == null) {
            logs = new ArrayList<>();
        }
        for (TreasureTurntableLogDetail detail : logs) {
            detail.initialize();
        }
    }

    public void addLog(TreasureTurntableLogDetail logDetail, int maxNum) {
        logs.add(0, logDetail);
        while(logs.size() > maxNum){
            logs.remove(logs.size() - 1);
        }
    }
}
